<?php

session_start();

if(@$_SESSION['logged']) {

parse_str($_POST['data']);

class MyDB extends SQLite3 {
	function __construct() {
		$this->open('access.db');
	}
}

$db = new MyDB();

if(!$db) { 
		echo $db->lastErrorMsg();
}

$sql = "SELECT uid,name FROM USERS WHERE name = '".$_POST['data']."';";

$results = $db->query($sql);

while ($row = $results->fetchArray(SQLITE3_ASSOC)) {
		$_SESSION['name'] = $row['name'];
		$_SESSION['uid'] = $row['uid'];
	}
}




?>